02. Getting Started
Getting Started
Dependencies
- Java 11 or higher
- Maven 3.6.3 or higher
- IntelliJ IDEA
Installation
- Download the JDK 14. Accept the license agreements and run the downloaded installer.
- Follow the official installation and run
mvn -version
in a terminal to make sure you have at least version 3.6.3 installed. - Download the Community Edition of IntelliJ IDEA. Run the downloaded installer.
Copying the Project Workspace
Go to the starter code GitHub repository. Find and click the green "Code" button, and follow the instructions there to either download the project in a .zip file or clone the repository onto your computer.
Once you have done this, if you are using IntelliJ, you can import the project using File > Open...
and then navigating to the nd079-c2-advanced-java-programming-techniques-projectstarter/starter
folder that you just downloaded.
Using the Terminal
In this project, you will be executing commands in a terminal to compile your code, run unit tests, and run the web crawler app. If you are using IntelliJ (recommended), you can use the built-in Terminal tab by clicking the "Terminal" button near the lower left corner of the main window, or by pressing the keyboard shortcut (Alt + F12
on Windows/Linux, or ⌥ + F12
on Mac).
If you already have another terminal application you like to use, such as the terminal that comes with the operating system you are running, that will also work with this project. If you go this route, make sure you run the terminal from the root directory of the project. In other words, the terminal's working directory should be the same folder where the pom.xml
file is located.
Note: If you are using IntelliJ's Terminal tab, it automatically opens the terminal in the project's root directory.
Once you have a terminal open, make sure everything is working by typing (or copy-pasting) the following mvn
command into the terminal and pressing the Enter
key:
mvn test -Dtest=WebCrawlerTest -DcrawlerImplementations=com.udacity.webcrawler.SequentialWebCrawler
(In case you're wondering, "mvn" is short for "Maven". This command tells Maven to run the unit test named WebCrawlerTest
, and uses a command-line flag to set the system property crawlerImplementations
to "com.udacity.webcrawler.SequentialWebCrawler".)
If it worked, you should see something like this at the bottom of the terminal:
[INFO] Results:
[INFO]
[INFO] Tests run: 13, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.017 s
[INFO] Finished at: 2020-09-17T21:35:46-04:00
[INFO] ------------------------------------------------------------------------
Unit Testing
The starter code comes with some JUnit 5 tests to check your work. You are not expected to write additional tests yourself. The instructions will tell you when and how to run the unit tests for each feature as you go.
If you do decide to write more tests yourself, please do not modify any of the existing tests. You can add new test files and you can add @Test
and @ParameterizedTest
methods to the existing test files, but please do not touch any of the existing @Test
or @ParameterizedTest
methods.
Getting Started Checklist
Task Feedback:
Look's like we're ready to start!